
import json
import requests
import time
import baozou_insert_sql
def zhangzhongyun1():
        Platform = "掌中云1_夜魅小说网"
        r = requests.session()
        url = "https://inovel.818tu.com/login/dologin"
        date ={
                "name" : "",
                "password" : "",
                "csessionid":"",
                "sig": "",
                "token":"",
                "scene": ""

        }

        rr = r.post(url = url,data = date)
        aa = r.get(url = "https://inovel.818tu.com/backend/order_stats/api_get_daily_stats/?limit=30")
        html = json.loads(aa.text)

        riqi = int(html[0]["date"])
        st = time.localtime(riqi)
        date_time =  time.strftime('%Y-%m-%d', st)
        Amount_share = int(html[0]["paid_amount"])/100*0.9
        Amount_share = round(Amount_share, 2)
        baozou_insert_sql.baozou_spider_everyday_sum(date_time,Amount_share,Platform)